
<%@include file="/WebPages/Includes/header.jsp"%>
<%@include file="/WebPages/Includes/startBody.jsp"%>
<%@include file="/WebPages/Includes/tablesorter.jsp"%>
<%@include file="/WebPages/Includes/navbar.jsp"%>
<%@include file="/WebPages/Includes/startMainContent.jsp"%>
<%@include file="/WebPages/Includes/leftSidebar.jsp"%>

<div class="col-lg-8 col-md-8 col-xs-12 col-sm-9"><hr>

	<button class="btn btn-primary btn-lg" data-target="#myInsertModal"
		data-toggle="modal">Create Master Class</button>

	<button class="btn btn-danger btn-lg" data-target="#myConfirmModal"
		data-toggle="modal" id="deleteSelectedRows">Delete Selected</button>
		
	<hr>

	<div class="table-responsive" style="overflow-x:auto; overflow-y:auto;" id="tableDiv">
	</div>

	<!-- Insert Modal -->
	<div aria-hidden="true" aria-labelledby="myInsertModalLabel"
		class="modal fade" id="myInsertModal" role="dialog" tabindex="-1">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button aria-hidden="true" class="close" data-dismiss="modal"
						type="button">&times;</button>
					<h4 class="modal-title" id="myInsertModalLabel">Create Master
						Section</h4>
				</div>
				<div class="modal-body">
					<form id="insertForm" method="post" name="insertForm" role="form">
						<script type="text/javascript">
							$(document)
									.ready(
											function() {
												var elements = [ [] ];
												elements = [
														
														[ "className",
																"className",
																"Class Name",
																false, false ],
														[
																"classDesc",
																"classDesc",
																"Class Description",
																false, false ] ];
												var toAppend = createFormGroupDivs(elements);
												$(toAppend)
														.insertBefore(
																"form#insertForm .modal-footer");
											});
						</script>
						<div class="modal-footer">
							<button class="btn btn-default" data-dismiss="modal"
								type="button">Close</button>
							<button class="btn btn-primary" id="insertMasterClass"
								type="button">Create Master Class</button>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>


	<!-- Update Modal -->
	<div aria-hidden="true" aria-labelledby="myModalLabel"
		class="modal fade" id="myUpdateModal" role="dialog" tabindex="-1">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button aria-hidden="true" class="close" data-dismiss="modal"
						type="button">&times;</button>
					<h4 class="modal-title" id="myModalLabel">Update Master
						Class</h4>
				</div>
				<div class="modal-body">
					<form id="updateForm" method="post">
						<script type="text/javascript">
							$(document)
									.ready(
											function() {
												var elements = [ [] ];
												elements = [
														
														[ "uclassName",
																"className",
																"Class Name",
																false, false ],
														[
																"uclassDesc",
																"classDesc",
																"Class Description",
																false, false ],
														[ "ucreatedBy",
																"createdBy",
																"Created By",
																true, true ],
														[ "ucreatedDate",
																"createdDate",
																"Created Date",
																true, true ] ];
												var toAppend = createFormGroupDivs(elements);
												$(toAppend)
														.insertBefore(
																"form#updateForm .modal-footer");
											});
						</script>
						<div class="modal-footer">
							<button class="btn btn-default" data-dismiss="modal"
								type="button">Close</button>
							<button class="btn btn-primary" id="updateMasterClass"
								type="button">Save changes</button>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>


	<!-- Confirm Modal -->
	<div aria-hidden="true" aria-labelledby="myConfirmModalLabel"
		class="modal fade" id="myConfirmModal" role="dialog" tabindex="-1">
		<div class="modal-dialog">
			<div align="center" class="modal-content">
				<div class="modal-header">
					<h4 class="modal-title" id="myConfirmModalLabel">Are you sure?</h4>
				</div>
				<div class="modal-body">
					<button class="btn btn-danger" id="confirmDelete" type="submit">Yes</button>
					<button class="btn btn-primary" id="cancelDelete" type="submit">No</button>
				</div>
			</div>
		</div>
	</div>
	<div class="modal fade bs-example-modal-sm" id="myErrorModal" tabindex="-1" role="dialog" aria-labelledby="myErrorModalLabel" aria-hidden="true">
	  <div class="modal-dialog modal-sm">
	    <div class="modal-content" align="center">
	    	<div class="modal-header">
					<h4 class="modal-title" id="myErrorModalLabel">Error</h4>
			</div>
			<div class="modal-body">
				<div id="ErrorContent"></div><hr/>
				<button class="btn btn-primary" id="errorOk" type="submit">Ok</button>
			</div>			
	    </div>	    
	  </div>
	</div>
	
</div>

<%@include file="/WebPages/Includes/rightSidebar.jsp"%>
<%@include file="/WebPages/Includes/endMainContent.jsp"%>
<%@include file="/WebPages/Includes/footer.jsp"%>

<!-- custom scripts here -->
<script src="./../../customJS/Webadmin/webadminClassHome.js"></script>

<%@include file="/WebPages/Includes/endBody.jsp"%>